package cn.tedu.boot31.mapper;

import cn.tedu.boot31.entity.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProductMapper {
    @Insert("insert into product values(null,#{title},#{price},#{saleCount})")
    void  insert(Product product);

    @Select("select * from product")
    @Result(column = "sale_count",property = "saleCount")
    List<Product> select();
}
